package mlz.c_newDateClass;

import java.time.LocalTime;

//LocalTime类 时 分 秒  -> 精确到纳秒
public class LocalTimeDemo02 {
    public static void main(String[] args) {
        //获取当前系统时间
        LocalTime lt = LocalTime.now();

        //获取时间中的信息
        int hour = lt.getHour();
        System.out.println(hour);
        int minute = lt.getMinute();
        System.out.println(minute);
        int nano = lt.getNano();
        System.out.println(nano);

        //加多少
        LocalTime hours = lt.plusHours(1);
        System.out.println(hours);//22:07:49.752253600

        //减多少
        LocalTime hours1 = lt.minusHours(1);
        System.out.println(hours1);//20:08:45.951692600

        //获取指定时间对象
        LocalTime localTime = LocalTime.of(12, 12, 12);
        System.out.println(localTime);//12:12:12
    }
}
